Creating your own Black & White models with MilkShape (c) 2001 DragonZap, dragonzap1@aol.com Creating your own meshes for use with Black & White is a fairly simple matter. In the case of the MilkShape plug-ins that I've written, you simply import the skeleton and maybe the mesh, make the changes you want, and export the new L3D file using the skeleton from the original L3D file. Then you replace the model or models in your "Data\CreatureMesh" directory in your Black & White installation folder and you're done. While that outlines the basic idea of how to create new models, there are some things you will have to be careful about as you go around making new models. Thus, I will go into further detail on the B&W model replacement process. Step 1: Import the skeleton and maybe the mesh, and generate a .BWC script -------------------------------------------------------------------------- The first step in creating a new model for Black & White using the MilkShape plug-ins is to import the skeleton. As of this writing, you cannot create your own skeletons or animations, so you must use an existing one. To do this from MilkShape, open the "File" menu, go down to "Import", and select "Black & White L3D". (This assumes you have already installed the files necessary for the L3D plug-ins. If you don't see "Black & White L3D", refer back to msL3DTools.txt, included with the plug-ins. If you followed the installation instructions there and still don't see it, send me an e-mail at dragonzap1@aol.com) Depending on which model you wish to replace, you may select any of the L3D files associated with it to retrieve a skeleton from, such as the good/neutral/evil models for creatures, or any of the three hand models if you wish to replace those, but MAKE SURE YOU REMEMBER WHICH FILE YOU GOT IT FROM. This will be necessary later on. Once you select a file to import, an options dialog will appear with a list of possible settings to use when importing the L3D file. For our purposes, we will want to leave the skeleton selection on its default setting ("Import skeleton without rotation information...") and leave the "Clear all before import" option checked. At this point, you will need to decide whether you want to create a completely new model, or make some changes to the one you're importing. If you want to create a new model, then you will want to uncheck "Import Mesh", and probably also want to uncheck "Extract textures to external files" if you intend to make your own skin to accompany the model you're creating. On the other hand, if you wish to make a modification to an existing model so that your new model's morph targets will work with the originals, you will want to make sure both "Import Mesh" and "Insert extra triangles to preserve morph targets" are checked off. Currently you MUST do this if you wish to replace any of the hand models, as the game tends to freeze if you try to make your own hand model from scratch (I'm assuming there's some hand models somewhere that I did not replace when I tried it). The import plug-in, by default, chooses some texture filenames automatically when it goes to extract the textures from the L3D file, but if you want to, you can choose alternate filenames by selecting the appropriate texture ID in the listbox and clicking the "Select Texture File" or "Select Alpha Texture File" buttons. Textures are currently exported in .BMP format. You will also want to generate a .BWC script. BWC files are a custom format that go along with the MilkShape plug-ins, and are used for putting some of the information in the .CBN files into human-readable form. They are text files, and as such can be edited with your favorite text editor. To make a .BWC script, check off the "Extract CBN info from..." box, and select a .CBN file in the first edit field. If you have not already chosen a .BWC filename, one will be chosen for you. Otherwise, you can select one yourself. Once you select all your options, click "Ok" and if all goes well, the skeleton (and mesh, if you imported it) should appear in MilkShape's view windows. Step 2: Making the new mesh --------------------------- The details of actually making a model with MilkShape are beyond the scope of this tutorial, but there are plenty of MilkShape tutorials out there on the Internet that can cover this topic. However, when making a model for Black & White, there are a few things you need to be aware of: First, do not move the bones around in any way. If you do, the changes will not be reflected when you go to export your model, and it will animate strangely in game. Secondly, do not do anything that changes the order of the bones. You should be able to rename them with no problem, but if you add or delete bones, you may screw up the algorithm that decides how to properly match them up with the skeletons from existing files. Secondly, if you chose to import the mesh and preserve the morph targets, do not do ANYTHING that modifies the number of triangles or vertices. Do not weld them together, do not subdivide them, do not reassign their bones, do not do anything except move them around and change their textures and texture coordinates. If you don't follow this advice and you save your changes, you will have to either start over, or settle for replacing all models of a given type (seven for creature models, or three for the hand model). Also, if you already made a model based off an original with an older version of the plug-ins, I'm sorry, but it won't work with the originals unless you re-make it. On the other hand, if you chose to make a completely new mesh, you will need to assign each vertex to one of the many bones in the imported skeletons. Which bones they are assigned to is an artistic matter and entirely up to you. If you're not sure how to assign bones, look for a MilkShape tutorial. If you decide to replace textures, (also known as skins) make sure the images are 256x256 pixels; no more, no less. The exporter will accept abnormally-sized textures, but they will be resized as needed, and tend to not look as good in-game. Also, textures will be quantized to 16 shades of red/green/blue and 16 alpha values if you choose to use an alpha channel. 4096 colors (16 * 16 * 16 = 4096) is generally enough for most everyone's purposes. Texture files can be in any format supported by the FreeImage library, (generally, if you can see it properly in MilkShape, it should work with the exporter) but for compatibility purposes it's probably best to stick to .BMP or .TGA files. From what I've read, Black & White's engine will determine bruise positions automatically, but for it to do this properly, you will need to make sure that no polygons on your UV texture map overlap. This means you cannot re-use any part of your texture on more than one part of your model. Step 3: Exporting your new model -------------------------------- Once you've made the changes and such that you desire, it's time to export your L3D file. Go to the "File" menu in MilkShape, open the "Export" submenu, and select "Black & White L3D". (Again, this assumes you've properly installed the plug-in files.) Select a file name to export to (do NOT overwrite the model you got the skeleton from, as you will need it) and you will be presented with an options dialog. The options for exporting are fewer than those for importing, but still just as important. If you are replacing a fat/thin/strong/weak model for a creature, you will want to make sure "Export textures" is NOT checked off. For all other purposes, it's probably best to leave it enabled. If you previously chose to modify an existing mesh instead of creating a completely new one, you will want to make sure "Preserve morph targets from imported model" is checked off. If you don't, your model will not work properly with the others in-game, and you will have to replace all the models from the set. Otherwise, leave that option unchecked. Lastly, you will want to check off "Use existing skeleton from:" and click on the "..." button to select the original L3D file from which you got your skeleton from. This is very important -- you will ALWAYS need to do this to create a model that will work in-game. Also, due to some problems with texture filenames in MilkShape, this model should be in the same directory as your texture files, or the textures may not be exported properly. If you only want to change the skins of a model, and not the model itself, you can check off "Only replace textures" to tell the plug-in not to replace any other information. Once everything is set, click "OK" to export your model. At this point, you may create other morph target versions of your model by moving vertices around and altering the textures, and exporting them exactly as you did with the first one. Morph targets are how Black & White blends models together to give each one a unique shape, such as a spiky, menacing sort of look for evil models, or a soft, cuddly look for good models. Also, remember that you don't need to export textures for fat/thin/strong/weak models. If you have to replace all the models of a specific type (either a creature or the hand) but you're feeling lazy, you can just copy your first model several times over rather than making new morph target versions. Step 4: Modifying the .BWC script --------------------------------- Chances are you will want to make a new CBN file to go along with your custom mesh. Using a .CBN file properly means that end users will only have to replace the .CBN files in their directories, and do not have to overwrite existing .L3D files. See the included BWC_Commands.txt for more information on the available .BWC script commands. When you're ready, load your base model into MilkShape, and then under the "Tools" menu, select "Compile Black & White BWC Script". From there, you will be prompted to select the .BWC file which will be used to create your .CBN file, and also the base .L3D file that goes along with the model you currently have loaded. You will also need to select a base .CBN file to use as a template similar to what was necessary when exporting the .L3D files, as I don't yet understand all of the fields in .CBN files. Lastly, you will need to select the filename of your new .CBN file. (Do NOT make it the same as your base .CBN file or bad things will happen.) If the .BWC script has any errors, the plug-in will let you know what line and what went wrong. Step 5: Getting the model in the game ------------------------------------- To get your model or models into the game, you will have to copy them to the "Data\CreatureMesh" directory, or wherever it was you found the original model that you got the skeleton from. It used to be that you had to overwrite the originals. This is NO LONGER TRUE for .L3D files, assuming that you changed the filenames in your .BWC script. However, it's probably a good idea to back up your original .CBN and model files first anyway so that you don't have to re-install the game if you mess up. If you chose to create a new .CBN file, you will have to copy that to the "Data\CTR" directory, and in that case you WILL need to overwrite the .CBN file of whatever creature you used as a base. (It should also be possible to replace the .CBN file of any creature.) When you export a new model, you will need to create a total of 7 model files. Let's take the cow model as an example. If I made a completely new cow model, I would have to make new versions of the following files: C_Cow_Boned.l3d C_Cow_Evil.l3d C_Cow_Good.l3d C_Cow_Fat.l3d C_Cow_Thin.l3d C_Cow_Strong.l3d C_Cow_Weak.l3d The first three would need textures, while the last four would not. On the other hand, if I only tweaked the cow mesh and made sure to preserve the morph targets correctly, I would only need to make new versions of the model or models that I changed. If you did everything correctly, then once you start the game, you should have your new model, which uses all the animations of the old one. You may notice that the eyes and/or hair or tail are not in the correct positions. Right now there's not much I can do about this, as I'm still not sure how Black & White determines eyeball positions or hair positions. You just have to sort of live with it for now. Remember that it's all still beta. Additionally, if you chose to modify an existing mesh rather than create your own, there may be some shading problems on texture boundaries, even if the normals are properly set up on the model. This should not occur with meshes made from scratch. Send questions/comments/bug reports to dragonzap1@aol.com. English only, please, as that's the only language I know.